﻿//Author:Michal Sporna
//License: https://operationsneakpeek.codeplex.com/license

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Microsoft.Xna.Framework;

namespace Screens
{
    /// <summary>
    /// represents the store
    /// where player can buy items for points
    /// </summary>
    public static class Store
    {
        public static void Draw()
        {
            try
            {
                Util.Cache.Draw(Util.Cache.GetTexture("StoreMockup").Text2D, new int[] { 0, 0, Util.Cache.GraphicsDevice.Viewport.Width, Util.Cache.GraphicsDevice.Viewport.Height }, Color.White);

            }
            catch (Exception ex)
            {
                Util.ErrorLogging.LogError(ex);
                return;
            }
        }


        /// <summary>
        /// press button in the store
        /// </summary>
        /// <param name="tap"></param>
        public static void PressButton(int[] tap)
        {
            try
            {
                if (tap[0] > 10 && tap[0] < 343 && tap[1] > 436 && tap[1] < 459)
                {
                    //go back to main menu
                    Util.Cache.SetCurrentScreen(Util.Cache.Screen.Menu);
                }

                //upgrade scanner1
                if (tap[0] > 460 && tap[0] < 515 && tap[1] > 105 && tap[1] < 135)
                {
                    //upgrade scanner
                    World.WorldManager.WorldConfig.ScannerDifficulty = 8;
                    World.WorldManager.WorldConfig.AutoScannerDifficulty = 8;
                }
                

            }
            catch (Exception ex)
            {
                Util.ErrorLogging.LogError(ex);
                return;
            }

        }
    }
}
